levels = dict(FATAL = 'Component cannot continue, or system is unusable.', ALERT = 'Action must be taken immediately.', CRITICAL = 'Critical conditions (on the system).', ERROR = 'Errors in the component; not errors from elsewhere.', WARNING = 'Problems that are recovered from, usually.', NOTICE = 'Normal but significant condition.', INFO = 'Informational messages that would be useful to a deployer or administrator.', DEBUG = 'Lower level information concerning program logic decisions, internal state, etc.', TRACE = 'Finest granularity, similar to "stepping through" the component or system.')
def __init__(self, date = None, **kw):
if not date:
pass
kw['ts'] = self.GLDate()
if not kw.get('gid'):
pass
kw['gid'] = os.getpid()
dict.__init__(self, kw)
def __str__(self):
StringIO = StringIO
import cStringIO
s = StringIO()
n = ' '
reserved = self.reserved
omitname = self.omitname
levels = self.levels
for k in list((filter,)((lambda i: self.has_key(i)), reserved)) + list((filter,)((lambda i: i not in reserved), self.keys())):
v = self[k]
if k in omitname:
s.write('%s ' % self.format[type(v)](v))
continue
if k == reserved[2] and v not in levels:
pass
s.write('%s=%s ' % (k, self.format[type(v)](v)))
s.write('\n')
return s.getvalue()
class GLDate(str):
def __new__(self, args = None):
import datetime
if not args:
pass
args = datetime.datetime.utcnow()
if not args.tzinfo:
pass
l = (args.year, args.month, args.day, args.hour, args.minute, args.second, args.microsecond, 'Z')